package com.bw.controller;

import com.bw.bean.Student;
import com.bw.server.UserServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class UserController {


    @Autowired //他就是到内存中找对象
    UserServer userServer;

    @GetMapping("/findAll")
    public List<Map> findAll(){
        return userServer.findAll();
    }


    @GetMapping("/findById")
    public Student findById(Integer id){
        return userServer.findById(id);
    }

}
